package com.product.system.controller;


import com.github.pagehelper.PageInfo;
import com.product.system.domain.request.ArgpLogisticsDeliver;
import com.product.system.domain.response.ArgpLogistics;
import com.product.system.service.ArgpLogisticsService;
import com.product.system.utils.Result;
import jnr.ffi.annotations.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("logistics")
public class ArgpLogisticsController {




    @Autowired
    ArgpLogisticsService argpLogisticsService;


    @GetMapping("getLogisticsList")
    public Result getLogisticsList(Integer pageNum,Integer pageSize,String trackingNumber) {
        PageInfo<ArgpLogistics> list = argpLogisticsService.getLogisticsList(pageNum,pageSize,trackingNumber);
        return Result.success(list);
    }


    @PostMapping("sureLogisticsDeliver")
    public Result sureLogisticsDeliver(@RequestBody ArgpLogisticsDeliver argpLogisticsDeliver) {
        boolean sureBoolean = argpLogisticsService.sureLogisticsDeliver(argpLogisticsDeliver);
        return sureBoolean?Result.success("发货成功"):Result.fail("发货失败");
    }




}
